import {Injectable} from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class AppService {

  public loading = false;
  public desc = '加载中...';

  constructor() {
  }

  setLoading(loading, desc?) {
    this.loading = loading;
    if (desc) {
      this.desc = desc;
    } else {
      this.desc = '加载中...';
    }
  }

  getLoading() {
    return this.loading;
  }

  getDesc() {
    return this.desc;
  }
}
